<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class ChangeColumnInitialEpisodeCodeLengthInPlaylistVersionTable extends AbstractMigration
{

    public function up()
    {
        $this->table('playlist_version')
            ->changeColumn('initial_episode_code', 'string', ['null' => false, 'default' => '', 'limit' => 256, 'comment' => '集code'])
            ->save();

        $this->table('playlist_item_version')
            ->changeColumn('initial_episode_code', 'string', ['null' => false, 'default' => '', 'limit' => 256, 'comment' => '集code'])
            ->save();
    }

    public function down()
    {

        $this->table('playlist_version')
            ->changeColumn('initial_episode_code', 'string', ['null' => false, 'default' => '', 'limit' => 20, 'comment' => '集code'])
            ->save();
        $this->table('playlist_version')
            ->changeColumn('initial_episode_code', 'string', ['null' => false, 'default' => '', 'limit' => 128, 'comment' => '集code'])
            ->save();
    }

}